﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace InfoWykaz
{
    public partial class PicDictValue : Form
    {
        int returnCol;
        public PicDictValue(string s, int retCol, DataTable query)
        {
            InitializeComponent();
            this.Text = s;
            this.returnCol = retCol;
            this.dataGridView1.DataSource = query;
        }

        public string value;
        public bool piced = false;

        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (this.dataGridView1.SelectedRows.Count > 0)
            {
                this.piced = true;
                this.value = this.dataGridView1.SelectedRows[0].Cells[this.returnCol].FormattedValue.ToString();
                this.Close();
            }
        }
    }
}
